/// <reference no-default-lib="true" />
/// <reference lib="esnext" />


const { Vector2 , Vector3 , Vector4 , Entity , Input , KeyCode } = Alice;

class Player extends Entity {
    speed:number;
    constructor(){
        super()
        this.speed = 10.0;
    }
    onUpdate(dt: number) {
        if ( Input.isKeyPress(KeyCode.A) ){
            this.position.x -= this.speed * dt;
        }else if( Input.isKeyPress(KeyCode.D) ){
            this.position.x += this.speed * dt;
        }else if ( Input.isKeyPress(KeyCode.W) ){
            this.position.y -= this.speed * dt;
        }else if( Input.isKeyPress(KeyCode.S) ){
            this.position.y += this.speed * dt;
        }
    }
}


